// 引入vue 模块
import vue from "vue";

//cnpm i --save-dev vue-router
//npm run serve
//npm install --save axios
//npm install --save vue-router

//引入vue-router模块
import vueRouter  from "vue-router";
//给vue模块增加路由功能
vue.use(vueRouter);

//引入路由
//import App from "./App.vue";
import kong from "../components/kong.vue";
import gedan from "../components/gedan.vue";
import hello from "../components/HelloWorld.vue";
import goodbye from "../components/goodbye.vue";
//import rank from "../components/rank.vue";
import regebang from "../components/regebang.vue";
import bofang from "../components/bofang.vue";
//import singer from "../components/singer.vue";

//引入子路由
//import zj from "../components/zj.vue";
//import mv from "../components/mv.vue";
//路由配置
const route=[	
	{path:"/gedan",component:gedan},
	{path:"/bofang",component:bofang},
	{path:"/",redirect:"/kong"},
	{
		path:"/kong",
		component:kong,
	    children:[
			{path:"/",redirect:"/hello"},
			{path:"/hello",component:hello},
			{path:"/bye",component:goodbye},
		//	{path:"/rank",component:rank},
			{path:"/regebang",component:regebang},
	// : singerid 表示一个占位符，与singerid参数对应
//	{
//		path:"/singer/:singerid",
//		component:singer,
//	    children:[
//	    	//redirect   重定向到指定的理由上
//	    	{path:"zj",component:zj,name:"zj"},
//	    	{path:"mv",component:mv,name:"mv"}
	    ]
},																																																																				
]
//创建router实例
const router =new vueRouter({
	routes : route
})
//输出router实例
export default router;